package guyubao.com.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import guyubao.com.entity.dto.JDAccountDto;
import guyubao.com.entity.dto.JDAccountInfoDto;
import guyubao.com.entity.vo.response.JDAccountInfoVo;
import org.apache.ibatis.annotations.*;

@Mapper
//CacheNamespace(implementation = MybatisRedisCache.class,eviction = MybatisRedisCache.class)
public interface JDAccountInfoMapper extends BaseMapper<JDAccountInfoDto> {
    //获取京东账号所有信息（一对一查询）
    @Results({
            @Result(id = true, column = "uId", property = "uId"),
            @Result(column = "pt_pin", property = "pt_pin"),
            @Result(column = "nickname", property = "nickname"),
            @Result(column = "comment", property = "comment"),
            @Result(column = "uId", property = "jdAccountInfoDto",
                    one=@One(select = "getJDAccountInfo")),
    })
    @Select("select * from JDAccount where uid=#{uid}")
    JDAccountInfoVo getJDAccountInfoVo(String uid);
    @Select("select * from JDAccount where uid=#{uid}")
    JDAccountDto getJDAccount(String uid);
    @Select("select * from JDAccountInfo where uid=#{uid}")
    JDAccountInfoDto getJDAccountInfo(String uid);
}
